﻿using Common;
using Network.UpdateData;
using System.Net.Sockets;

namespace SFJDService.SocketHandle
{
    /// <summary>
    /// 接收到消息后直接在Contact.xml文件里添加数据
    /// </summary>
    public class PH03AddContact : PacketHandle
    {
        /// <summary>
        /// UDP, code 1044
        /// </summary>
        /// <param name="socket"></param>
        /// <param name="packet"></param>
        public PH03AddContact(Socket socket, Packet packet) : base(socket, packet) { }

        protected override void Handle()
        {
            ClassContact contact = new ClassContact();
            try
            {
                contact.DecodingFromString(Message);
                Runtime.xmlContact.AddContact(contact);
            }
            catch { }
        }
    }
}
